#include <bits/stdc++.h>

using namespace std;

#define ve vector<int>
#define pb push_back

int n;

ve dfs(ve nu,int dep){
	if(dep == 19) return ve(0);
	bool f = 0;
	for(int i = 0;i < nu.size();i++) if(nu[i] & 1) f = 1;
	if(!f){
		for(int i = 0;i < nu.size();i++) nu[i]>>=1;
		return dfs(nu,dep+1);
	}
	ve tmp = nu;
	for(int i = 0;i < tmp.size();i++)
		if(tmp[i] & 1) tmp[i] = (tmp[i] + 1)>>1;
		else tmp[i] >>= 1;
	sort(tmp.begin(),tmp.end());
	tmp.resize(unique(tmp.begin(),tmp.end())-tmp.begin());
	ve ans1 = dfs(tmp,dep+1);
	tmp = nu;
	for(int i = 0;i < tmp.size();i++)
		if(tmp[i] & 1) tmp[i] = (tmp[i] - 1)>>1;
		else tmp[i]>>=1;
	sort(tmp.begin(),tmp.end());
	tmp.resize(unique(tmp.begin(),tmp.end())-tmp.begin());
	ve ans2 = dfs(tmp,dep+1);
	ans1.pb(-(1<<dep));
	ans2.pb((1<<dep));
	if(ans1.size() < ans2.size()) return ans1;
	return ans2;
}

int main (){
					 
	ve nu;
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		int x;scanf("%d",&x);
		nu.pb(x);
	}
	ve ans = dfs(nu,0);
	printf("%d\n",ans.size());
	sort(ans.begin(),ans.end());
	for(int i = 0;i < ans.size();i++){
		printf("%d ",ans[i]);
	}
	return 0;
}
